﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace _8.Base64FileEncryptor
{
    class Program
    {
        static void Main(string[] args)
        {
            using(var reader = 
                //new StreamReader("input.txt", true))
                new FileStream("input.txt", FileMode.Open))
            {
                using (var writer = new StreamWriter("output.txt"))
                {
                    Base64StreamEncryptor.Encrypt(reader, writer);
                }
            }

            using (var reader = new StreamReader("output.txt"))
            {
                using (var writer = new StreamWriter("decrypted.txt"))
                {
                    Base64StreamEncryptor.Decrypt(reader, writer);
                }
            }
        }        
    }
}
